class Cache {
  constructor() {
    this.E = localStorage
  }

  get(name = 'drawCache') {
    return this.E.getItem(name) ? JSON.parse(this.E.getItem(name)) : null
  }
  set(name = 'drawCache', val = '') {
    this.E.setItem(name, JSON.stringify(val))
  }

  remove(name = 'drawCache') {
    this.E.setItem(name, '')
  }
}

export default new Cache()
